<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Create HttpMessage from environment</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="httpmessage.factory.html">HttpMessage::factory</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="httpmessage.fromstring.html">HttpMessage::fromString</a></div>
 <div class="up"><a href="class.httpmessage.html">HttpMessage</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="httpmessage.fromenv" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">HttpMessage::fromEnv</h1>
  <p class="verinfo">(PECL pecl_http &gt;= 1.5.0)</p><p class="refpurpose"><span class="refname">HttpMessage::fromEnv</span> &mdash; <span class="dc-title">Create HttpMessage from environment</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-httpmessage.fromenv-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">static public</span>
   <span class="type"><a href="class.httpmessage.html" class="type HttpMessage">HttpMessage</a></span> <span class="methodname"><strong>HttpMessage::fromEnv</strong></span>
    ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$message_type</code></span>
   [, <span class="methodparam"><span class="type">string</span> <code class="parameter">$class_name</code><span class="initializer"> = &quot;HttpMessage&quot;</span></span>
  ] )</div>


  <p class="para rdfs-comment">
   Create an <a href="class.httpmessage.html" class="classname">HttpMessage</a> object from script environment.
  </p>

 </div>

 <div class="refsect1 parameters" id="refsect1-httpmessage.fromenv-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">message_type</code></em></dt>

     <dd>

      <p class="para">
       The message type. See <a href="class.httpmessage.html#http.httpmessage.constants" class="link">HttpMessage type constants</a>.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">class_name</code></em></dt>

     <dd>

      <p class="para">
       a class extending <a href="class.httpmessage.html" class="classname">HttpMessage</a>
      </p>
     </dd>

    
   </dl>

  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-httpmessage.fromenv-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns an <a href="class.httpmessage.html" class="classname">HttpMessage</a> object on success or <strong><code>NULL</code></strong> on failure.
  </p>
 </div>


 

 


 


 <div class="refsect1 seealso" id="refsect1-httpmessage.fromenv-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="httpmessage.factory.html" class="function" rel="rdfs-seeAlso">HttpMessage::factory()</a> - Create HttpMessage from string</span>.</li>
   </ul>
  </p>
 </div>



</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="httpmessage.factory.html">HttpMessage::factory</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="httpmessage.fromstring.html">HttpMessage::fromString</a></div>
 <div class="up"><a href="class.httpmessage.html">HttpMessage</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
